package com.xinqi.modules.exam.task.controller.inner;

import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.exam.task.client.AsyncTaskProcessLogClient;
import com.xinqi.modules.exam.task.dto.req.AsyncTaskProcessLogQueryDTO;
import com.xinqi.modules.exam.task.dto.rsp.AsyncTaskProcessLogResultDTO;
import com.xinqi.modules.exam.task.service.AsyncTaskProcessLogService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.RestController;

/**
 * 异步任务处理日志内部控制层
 *
 * @author: linkai
 * @date: 2023/07/08
 */
@Hidden
@Primary
@RestController
@RequiredArgsConstructor
public class AsyncTaskProcessLogInnerController implements AsyncTaskProcessLogClient {
    private final AsyncTaskProcessLogService asyncTaskProcessLogService;

    @Override
    public R<PageInfo<AsyncTaskProcessLogResultDTO>> page(AsyncTaskProcessLogQueryDTO dto) {
        PageInfo<AsyncTaskProcessLogResultDTO> page = asyncTaskProcessLogService.page(dto, dto);
        return R.data(page);
    }

    @Override
    public R<AsyncTaskProcessLogResultDTO> findById(Long id) {
        AsyncTaskProcessLogResultDTO dto = asyncTaskProcessLogService.findById(id);
        return R.data(dto);
    }
}
